
#ifndef  BREAKPOINTSTATE_H
#define  BREAKPOINTSTATE_H

#include <ostream>

class BreakPointState {
public:
    BreakPointState();
    ~BreakPointState();

    bool isEnd() const ;
    bool isInited() const ;
    bool isConnected() const;
    bool isLogined() const ;
    bool isDisconnected() const;

    // State Switch Table   
    //      [cur][next] == 1 => switch Ok;  
    //      [cur][next] == 0 -> Failed
    //            END -> INITED -> CONNECTED -> LOGINED -> DISCONNECTED
    //    
    //END          0       1           0           0           0
    //
    //INITED       1       0           1           0           0
    //
    //CONNECTED    1       0           0           1           1
    //
    //LOGINED      1       0           0           0           1
    //
    //DISCONNECTED 1       0           0           0           0
    int toEnd();
    int toInited() ;
    int toConnected();
    int toLogined();
    int toDisconnected();

    std::ostream &  log(std::ostream & out);

private:
    int status;

    static const int END = 0;
    static const int INITED = 1;
    static const int CONNECTED = 2;
    static const int LOGINED = 3;
    static const int DISCONNECTED = 4;
};


#endif   /* BREAKPOINTSTATE_H */
